#pragma once
// MESSAGE ATT_BODY_DEBUG PACKING

#define MAVLINK_MSG_ID_ATT_BODY_DEBUG 25

MAVPACKED(
typedef struct __mavlink_att_body_debug_t {
 float roll_obs; /*<  roll observe.*/
 float pitch_obs; /*<  pitch observe.*/
 float yaw_obs_mag; /*<  yaw observe with magnet.*/
 float yaw_obs_rtk; /*<  yaw observe with rtk.*/
 float roll_obs_sub_pred; /*<  roll observe deviation.*/
 float pitch_obs_sub_pred; /*<  roll observe deviation.*/
 float yaw_obs_sub_pred; /*<  roll observe deviation.*/
 float f_ib_n_x; /*<  x force in B coordinate.*/
 float f_ib_n_y; /*<  y force in B coordinate.*/
 float f_ib_n_z; /*<  z force in B coordinate.*/
 float g0_x; /*<  g0_x.*/
 float g0_y; /*<  g0_y.*/
 float g0_z; /*<  g0_z.*/
 float declination; /*<  declination.*/
 float inclination; /*<  inclination.*/
 float nm_earth_x; /*<  nm_earth_x.*/
 float nm_earth_y; /*<  nm_earth_y.*/
 float nm_earth_z; /*<  nm_earth_z.*/
 float nm_x; /*<  nm_x.*/
 float nm_y; /*<  nm_y.*/
 float nm_z; /*<  nm_z.*/
 float RN; /*<  RN.*/
 float RE; /*<  RE.*/
 float v_eb_n_obs_x; /*<  v_eb_n_obs_x.*/
 float v_eb_n_obs_y; /*<  v_eb_n_obs_y.*/
 float v_eb_n_obs_z; /*<  v_eb_n_obs_z.*/
 float p_eb_n_obs_x; /*<  p_eb_n_obs_x.*/
 float p_eb_n_obs_y; /*<  p_eb_n_obs_y.*/
 float p_eb_n_obs_z; /*<  p_eb_n_obs_z.*/
 float w_ib_b_norm; /*<  w_ib_b_norm.*/
 float f_ib_b_norm; /*<  f_ib_b_norm.*/
 float bm_norm; /*<  bm_norm.*/
 uint32_t time_used; /*<  used time.*/
 uint32_t dt; /*<  dt.*/
 uint32_t static_state; /*<  static state.*/
 uint32_t disturb_state; /*<  disturb state.*/
}) mavlink_att_body_debug_t;

#define MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN 144
#define MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN 144
#define MAVLINK_MSG_ID_25_LEN 144
#define MAVLINK_MSG_ID_25_MIN_LEN 144

#define MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC 223
#define MAVLINK_MSG_ID_25_CRC 223



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ATT_BODY_DEBUG { \
    25, \
    "ATT_BODY_DEBUG", \
    36, \
    {  { "roll_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_att_body_debug_t, roll_obs) }, \
         { "pitch_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_att_body_debug_t, pitch_obs) }, \
         { "yaw_obs_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_att_body_debug_t, yaw_obs_mag) }, \
         { "yaw_obs_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_att_body_debug_t, yaw_obs_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_att_body_debug_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_att_body_debug_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_body_debug_t, yaw_obs_sub_pred) }, \
         { "f_ib_n_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_body_debug_t, f_ib_n_x) }, \
         { "f_ib_n_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_body_debug_t, f_ib_n_y) }, \
         { "f_ib_n_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_att_body_debug_t, f_ib_n_z) }, \
         { "g0_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_att_body_debug_t, g0_x) }, \
         { "g0_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_att_body_debug_t, g0_y) }, \
         { "g0_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_att_body_debug_t, g0_z) }, \
         { "declination", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_att_body_debug_t, declination) }, \
         { "inclination", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_att_body_debug_t, inclination) }, \
         { "nm_earth_x", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_att_body_debug_t, nm_earth_x) }, \
         { "nm_earth_y", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_att_body_debug_t, nm_earth_y) }, \
         { "nm_earth_z", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_att_body_debug_t, nm_earth_z) }, \
         { "nm_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_att_body_debug_t, nm_x) }, \
         { "nm_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_att_body_debug_t, nm_y) }, \
         { "nm_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_att_body_debug_t, nm_z) }, \
         { "RN", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_att_body_debug_t, RN) }, \
         { "RE", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_att_body_debug_t, RE) }, \
         { "v_eb_n_obs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_x) }, \
         { "v_eb_n_obs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_y) }, \
         { "v_eb_n_obs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 100, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_z) }, \
         { "p_eb_n_obs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 104, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_x) }, \
         { "p_eb_n_obs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 108, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_y) }, \
         { "p_eb_n_obs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 112, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_z) }, \
         { "w_ib_b_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 116, offsetof(mavlink_att_body_debug_t, w_ib_b_norm) }, \
         { "f_ib_b_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 120, offsetof(mavlink_att_body_debug_t, f_ib_b_norm) }, \
         { "bm_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 124, offsetof(mavlink_att_body_debug_t, bm_norm) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 128, offsetof(mavlink_att_body_debug_t, time_used) }, \
         { "dt", NULL, MAVLINK_TYPE_UINT32_T, 0, 132, offsetof(mavlink_att_body_debug_t, dt) }, \
         { "static_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 136, offsetof(mavlink_att_body_debug_t, static_state) }, \
         { "disturb_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 140, offsetof(mavlink_att_body_debug_t, disturb_state) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_ATT_BODY_DEBUG { \
    "ATT_BODY_DEBUG", \
    36, \
    {  { "roll_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_att_body_debug_t, roll_obs) }, \
         { "pitch_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_att_body_debug_t, pitch_obs) }, \
         { "yaw_obs_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_att_body_debug_t, yaw_obs_mag) }, \
         { "yaw_obs_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_att_body_debug_t, yaw_obs_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_att_body_debug_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_att_body_debug_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_body_debug_t, yaw_obs_sub_pred) }, \
         { "f_ib_n_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_body_debug_t, f_ib_n_x) }, \
         { "f_ib_n_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_body_debug_t, f_ib_n_y) }, \
         { "f_ib_n_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_att_body_debug_t, f_ib_n_z) }, \
         { "g0_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_att_body_debug_t, g0_x) }, \
         { "g0_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_att_body_debug_t, g0_y) }, \
         { "g0_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_att_body_debug_t, g0_z) }, \
         { "declination", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_att_body_debug_t, declination) }, \
         { "inclination", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_att_body_debug_t, inclination) }, \
         { "nm_earth_x", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_att_body_debug_t, nm_earth_x) }, \
         { "nm_earth_y", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_att_body_debug_t, nm_earth_y) }, \
         { "nm_earth_z", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_att_body_debug_t, nm_earth_z) }, \
         { "nm_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_att_body_debug_t, nm_x) }, \
         { "nm_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_att_body_debug_t, nm_y) }, \
         { "nm_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_att_body_debug_t, nm_z) }, \
         { "RN", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_att_body_debug_t, RN) }, \
         { "RE", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_att_body_debug_t, RE) }, \
         { "v_eb_n_obs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_x) }, \
         { "v_eb_n_obs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_y) }, \
         { "v_eb_n_obs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 100, offsetof(mavlink_att_body_debug_t, v_eb_n_obs_z) }, \
         { "p_eb_n_obs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 104, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_x) }, \
         { "p_eb_n_obs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 108, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_y) }, \
         { "p_eb_n_obs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 112, offsetof(mavlink_att_body_debug_t, p_eb_n_obs_z) }, \
         { "w_ib_b_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 116, offsetof(mavlink_att_body_debug_t, w_ib_b_norm) }, \
         { "f_ib_b_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 120, offsetof(mavlink_att_body_debug_t, f_ib_b_norm) }, \
         { "bm_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 124, offsetof(mavlink_att_body_debug_t, bm_norm) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 128, offsetof(mavlink_att_body_debug_t, time_used) }, \
         { "dt", NULL, MAVLINK_TYPE_UINT32_T, 0, 132, offsetof(mavlink_att_body_debug_t, dt) }, \
         { "static_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 136, offsetof(mavlink_att_body_debug_t, static_state) }, \
         { "disturb_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 140, offsetof(mavlink_att_body_debug_t, disturb_state) }, \
         } \
}
#endif

/**
 * @brief Pack a att_body_debug message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw observe with magnet.
 * @param yaw_obs_rtk  yaw observe with rtk.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param f_ib_n_x  x force in B coordinate.
 * @param f_ib_n_y  y force in B coordinate.
 * @param f_ib_n_z  z force in B coordinate.
 * @param g0_x  g0_x.
 * @param g0_y  g0_y.
 * @param g0_z  g0_z.
 * @param declination  declination.
 * @param inclination  inclination.
 * @param nm_earth_x  nm_earth_x.
 * @param nm_earth_y  nm_earth_y.
 * @param nm_earth_z  nm_earth_z.
 * @param nm_x  nm_x.
 * @param nm_y  nm_y.
 * @param nm_z  nm_z.
 * @param RN  RN.
 * @param RE  RE.
 * @param v_eb_n_obs_x  v_eb_n_obs_x.
 * @param v_eb_n_obs_y  v_eb_n_obs_y.
 * @param v_eb_n_obs_z  v_eb_n_obs_z.
 * @param p_eb_n_obs_x  p_eb_n_obs_x.
 * @param p_eb_n_obs_y  p_eb_n_obs_y.
 * @param p_eb_n_obs_z  p_eb_n_obs_z.
 * @param w_ib_b_norm  w_ib_b_norm.
 * @param f_ib_b_norm  f_ib_b_norm.
 * @param bm_norm  bm_norm.
 * @param time_used  used time.
 * @param dt  dt.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_att_body_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float f_ib_n_x, float f_ib_n_y, float f_ib_n_z, float g0_x, float g0_y, float g0_z, float declination, float inclination, float nm_earth_x, float nm_earth_y, float nm_earth_z, float nm_x, float nm_y, float nm_z, float RN, float RE, float v_eb_n_obs_x, float v_eb_n_obs_y, float v_eb_n_obs_z, float p_eb_n_obs_x, float p_eb_n_obs_y, float p_eb_n_obs_z, float w_ib_b_norm, float f_ib_b_norm, float bm_norm, uint32_t time_used, uint32_t dt, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_obs);
    _mav_put_float(buf, 4, pitch_obs);
    _mav_put_float(buf, 8, yaw_obs_mag);
    _mav_put_float(buf, 12, yaw_obs_rtk);
    _mav_put_float(buf, 16, roll_obs_sub_pred);
    _mav_put_float(buf, 20, pitch_obs_sub_pred);
    _mav_put_float(buf, 24, yaw_obs_sub_pred);
    _mav_put_float(buf, 28, f_ib_n_x);
    _mav_put_float(buf, 32, f_ib_n_y);
    _mav_put_float(buf, 36, f_ib_n_z);
    _mav_put_float(buf, 40, g0_x);
    _mav_put_float(buf, 44, g0_y);
    _mav_put_float(buf, 48, g0_z);
    _mav_put_float(buf, 52, declination);
    _mav_put_float(buf, 56, inclination);
    _mav_put_float(buf, 60, nm_earth_x);
    _mav_put_float(buf, 64, nm_earth_y);
    _mav_put_float(buf, 68, nm_earth_z);
    _mav_put_float(buf, 72, nm_x);
    _mav_put_float(buf, 76, nm_y);
    _mav_put_float(buf, 80, nm_z);
    _mav_put_float(buf, 84, RN);
    _mav_put_float(buf, 88, RE);
    _mav_put_float(buf, 92, v_eb_n_obs_x);
    _mav_put_float(buf, 96, v_eb_n_obs_y);
    _mav_put_float(buf, 100, v_eb_n_obs_z);
    _mav_put_float(buf, 104, p_eb_n_obs_x);
    _mav_put_float(buf, 108, p_eb_n_obs_y);
    _mav_put_float(buf, 112, p_eb_n_obs_z);
    _mav_put_float(buf, 116, w_ib_b_norm);
    _mav_put_float(buf, 120, f_ib_b_norm);
    _mav_put_float(buf, 124, bm_norm);
    _mav_put_uint32_t(buf, 128, time_used);
    _mav_put_uint32_t(buf, 132, dt);
    _mav_put_uint32_t(buf, 136, static_state);
    _mav_put_uint32_t(buf, 140, disturb_state);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN);
#else
    mavlink_att_body_debug_t packet;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.f_ib_n_x = f_ib_n_x;
    packet.f_ib_n_y = f_ib_n_y;
    packet.f_ib_n_z = f_ib_n_z;
    packet.g0_x = g0_x;
    packet.g0_y = g0_y;
    packet.g0_z = g0_z;
    packet.declination = declination;
    packet.inclination = inclination;
    packet.nm_earth_x = nm_earth_x;
    packet.nm_earth_y = nm_earth_y;
    packet.nm_earth_z = nm_earth_z;
    packet.nm_x = nm_x;
    packet.nm_y = nm_y;
    packet.nm_z = nm_z;
    packet.RN = RN;
    packet.RE = RE;
    packet.v_eb_n_obs_x = v_eb_n_obs_x;
    packet.v_eb_n_obs_y = v_eb_n_obs_y;
    packet.v_eb_n_obs_z = v_eb_n_obs_z;
    packet.p_eb_n_obs_x = p_eb_n_obs_x;
    packet.p_eb_n_obs_y = p_eb_n_obs_y;
    packet.p_eb_n_obs_z = p_eb_n_obs_z;
    packet.w_ib_b_norm = w_ib_b_norm;
    packet.f_ib_b_norm = f_ib_b_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.dt = dt;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATT_BODY_DEBUG;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
}

/**
 * @brief Pack a att_body_debug message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw observe with magnet.
 * @param yaw_obs_rtk  yaw observe with rtk.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param f_ib_n_x  x force in B coordinate.
 * @param f_ib_n_y  y force in B coordinate.
 * @param f_ib_n_z  z force in B coordinate.
 * @param g0_x  g0_x.
 * @param g0_y  g0_y.
 * @param g0_z  g0_z.
 * @param declination  declination.
 * @param inclination  inclination.
 * @param nm_earth_x  nm_earth_x.
 * @param nm_earth_y  nm_earth_y.
 * @param nm_earth_z  nm_earth_z.
 * @param nm_x  nm_x.
 * @param nm_y  nm_y.
 * @param nm_z  nm_z.
 * @param RN  RN.
 * @param RE  RE.
 * @param v_eb_n_obs_x  v_eb_n_obs_x.
 * @param v_eb_n_obs_y  v_eb_n_obs_y.
 * @param v_eb_n_obs_z  v_eb_n_obs_z.
 * @param p_eb_n_obs_x  p_eb_n_obs_x.
 * @param p_eb_n_obs_y  p_eb_n_obs_y.
 * @param p_eb_n_obs_z  p_eb_n_obs_z.
 * @param w_ib_b_norm  w_ib_b_norm.
 * @param f_ib_b_norm  f_ib_b_norm.
 * @param bm_norm  bm_norm.
 * @param time_used  used time.
 * @param dt  dt.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_att_body_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   float roll_obs,float pitch_obs,float yaw_obs_mag,float yaw_obs_rtk,float roll_obs_sub_pred,float pitch_obs_sub_pred,float yaw_obs_sub_pred,float f_ib_n_x,float f_ib_n_y,float f_ib_n_z,float g0_x,float g0_y,float g0_z,float declination,float inclination,float nm_earth_x,float nm_earth_y,float nm_earth_z,float nm_x,float nm_y,float nm_z,float RN,float RE,float v_eb_n_obs_x,float v_eb_n_obs_y,float v_eb_n_obs_z,float p_eb_n_obs_x,float p_eb_n_obs_y,float p_eb_n_obs_z,float w_ib_b_norm,float f_ib_b_norm,float bm_norm,uint32_t time_used,uint32_t dt,uint32_t static_state,uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_obs);
    _mav_put_float(buf, 4, pitch_obs);
    _mav_put_float(buf, 8, yaw_obs_mag);
    _mav_put_float(buf, 12, yaw_obs_rtk);
    _mav_put_float(buf, 16, roll_obs_sub_pred);
    _mav_put_float(buf, 20, pitch_obs_sub_pred);
    _mav_put_float(buf, 24, yaw_obs_sub_pred);
    _mav_put_float(buf, 28, f_ib_n_x);
    _mav_put_float(buf, 32, f_ib_n_y);
    _mav_put_float(buf, 36, f_ib_n_z);
    _mav_put_float(buf, 40, g0_x);
    _mav_put_float(buf, 44, g0_y);
    _mav_put_float(buf, 48, g0_z);
    _mav_put_float(buf, 52, declination);
    _mav_put_float(buf, 56, inclination);
    _mav_put_float(buf, 60, nm_earth_x);
    _mav_put_float(buf, 64, nm_earth_y);
    _mav_put_float(buf, 68, nm_earth_z);
    _mav_put_float(buf, 72, nm_x);
    _mav_put_float(buf, 76, nm_y);
    _mav_put_float(buf, 80, nm_z);
    _mav_put_float(buf, 84, RN);
    _mav_put_float(buf, 88, RE);
    _mav_put_float(buf, 92, v_eb_n_obs_x);
    _mav_put_float(buf, 96, v_eb_n_obs_y);
    _mav_put_float(buf, 100, v_eb_n_obs_z);
    _mav_put_float(buf, 104, p_eb_n_obs_x);
    _mav_put_float(buf, 108, p_eb_n_obs_y);
    _mav_put_float(buf, 112, p_eb_n_obs_z);
    _mav_put_float(buf, 116, w_ib_b_norm);
    _mav_put_float(buf, 120, f_ib_b_norm);
    _mav_put_float(buf, 124, bm_norm);
    _mav_put_uint32_t(buf, 128, time_used);
    _mav_put_uint32_t(buf, 132, dt);
    _mav_put_uint32_t(buf, 136, static_state);
    _mav_put_uint32_t(buf, 140, disturb_state);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN);
#else
    mavlink_att_body_debug_t packet;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.f_ib_n_x = f_ib_n_x;
    packet.f_ib_n_y = f_ib_n_y;
    packet.f_ib_n_z = f_ib_n_z;
    packet.g0_x = g0_x;
    packet.g0_y = g0_y;
    packet.g0_z = g0_z;
    packet.declination = declination;
    packet.inclination = inclination;
    packet.nm_earth_x = nm_earth_x;
    packet.nm_earth_y = nm_earth_y;
    packet.nm_earth_z = nm_earth_z;
    packet.nm_x = nm_x;
    packet.nm_y = nm_y;
    packet.nm_z = nm_z;
    packet.RN = RN;
    packet.RE = RE;
    packet.v_eb_n_obs_x = v_eb_n_obs_x;
    packet.v_eb_n_obs_y = v_eb_n_obs_y;
    packet.v_eb_n_obs_z = v_eb_n_obs_z;
    packet.p_eb_n_obs_x = p_eb_n_obs_x;
    packet.p_eb_n_obs_y = p_eb_n_obs_y;
    packet.p_eb_n_obs_z = p_eb_n_obs_z;
    packet.w_ib_b_norm = w_ib_b_norm;
    packet.f_ib_b_norm = f_ib_b_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.dt = dt;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATT_BODY_DEBUG;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
}

/**
 * @brief Encode a att_body_debug struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param att_body_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_att_body_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_body_debug_t* att_body_debug)
{
    return mavlink_msg_att_body_debug_pack(system_id, component_id, msg, att_body_debug->roll_obs, att_body_debug->pitch_obs, att_body_debug->yaw_obs_mag, att_body_debug->yaw_obs_rtk, att_body_debug->roll_obs_sub_pred, att_body_debug->pitch_obs_sub_pred, att_body_debug->yaw_obs_sub_pred, att_body_debug->f_ib_n_x, att_body_debug->f_ib_n_y, att_body_debug->f_ib_n_z, att_body_debug->g0_x, att_body_debug->g0_y, att_body_debug->g0_z, att_body_debug->declination, att_body_debug->inclination, att_body_debug->nm_earth_x, att_body_debug->nm_earth_y, att_body_debug->nm_earth_z, att_body_debug->nm_x, att_body_debug->nm_y, att_body_debug->nm_z, att_body_debug->RN, att_body_debug->RE, att_body_debug->v_eb_n_obs_x, att_body_debug->v_eb_n_obs_y, att_body_debug->v_eb_n_obs_z, att_body_debug->p_eb_n_obs_x, att_body_debug->p_eb_n_obs_y, att_body_debug->p_eb_n_obs_z, att_body_debug->w_ib_b_norm, att_body_debug->f_ib_b_norm, att_body_debug->bm_norm, att_body_debug->time_used, att_body_debug->dt, att_body_debug->static_state, att_body_debug->disturb_state);
}

/**
 * @brief Encode a att_body_debug struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param att_body_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_att_body_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_body_debug_t* att_body_debug)
{
    return mavlink_msg_att_body_debug_pack_chan(system_id, component_id, chan, msg, att_body_debug->roll_obs, att_body_debug->pitch_obs, att_body_debug->yaw_obs_mag, att_body_debug->yaw_obs_rtk, att_body_debug->roll_obs_sub_pred, att_body_debug->pitch_obs_sub_pred, att_body_debug->yaw_obs_sub_pred, att_body_debug->f_ib_n_x, att_body_debug->f_ib_n_y, att_body_debug->f_ib_n_z, att_body_debug->g0_x, att_body_debug->g0_y, att_body_debug->g0_z, att_body_debug->declination, att_body_debug->inclination, att_body_debug->nm_earth_x, att_body_debug->nm_earth_y, att_body_debug->nm_earth_z, att_body_debug->nm_x, att_body_debug->nm_y, att_body_debug->nm_z, att_body_debug->RN, att_body_debug->RE, att_body_debug->v_eb_n_obs_x, att_body_debug->v_eb_n_obs_y, att_body_debug->v_eb_n_obs_z, att_body_debug->p_eb_n_obs_x, att_body_debug->p_eb_n_obs_y, att_body_debug->p_eb_n_obs_z, att_body_debug->w_ib_b_norm, att_body_debug->f_ib_b_norm, att_body_debug->bm_norm, att_body_debug->time_used, att_body_debug->dt, att_body_debug->static_state, att_body_debug->disturb_state);
}

/**
 * @brief Send a att_body_debug message
 * @param chan MAVLink channel to send the message
 *
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw observe with magnet.
 * @param yaw_obs_rtk  yaw observe with rtk.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param f_ib_n_x  x force in B coordinate.
 * @param f_ib_n_y  y force in B coordinate.
 * @param f_ib_n_z  z force in B coordinate.
 * @param g0_x  g0_x.
 * @param g0_y  g0_y.
 * @param g0_z  g0_z.
 * @param declination  declination.
 * @param inclination  inclination.
 * @param nm_earth_x  nm_earth_x.
 * @param nm_earth_y  nm_earth_y.
 * @param nm_earth_z  nm_earth_z.
 * @param nm_x  nm_x.
 * @param nm_y  nm_y.
 * @param nm_z  nm_z.
 * @param RN  RN.
 * @param RE  RE.
 * @param v_eb_n_obs_x  v_eb_n_obs_x.
 * @param v_eb_n_obs_y  v_eb_n_obs_y.
 * @param v_eb_n_obs_z  v_eb_n_obs_z.
 * @param p_eb_n_obs_x  p_eb_n_obs_x.
 * @param p_eb_n_obs_y  p_eb_n_obs_y.
 * @param p_eb_n_obs_z  p_eb_n_obs_z.
 * @param w_ib_b_norm  w_ib_b_norm.
 * @param f_ib_b_norm  f_ib_b_norm.
 * @param bm_norm  bm_norm.
 * @param time_used  used time.
 * @param dt  dt.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_att_body_debug_send(mavlink_channel_t chan, float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float f_ib_n_x, float f_ib_n_y, float f_ib_n_z, float g0_x, float g0_y, float g0_z, float declination, float inclination, float nm_earth_x, float nm_earth_y, float nm_earth_z, float nm_x, float nm_y, float nm_z, float RN, float RE, float v_eb_n_obs_x, float v_eb_n_obs_y, float v_eb_n_obs_z, float p_eb_n_obs_x, float p_eb_n_obs_y, float p_eb_n_obs_z, float w_ib_b_norm, float f_ib_b_norm, float bm_norm, uint32_t time_used, uint32_t dt, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_obs);
    _mav_put_float(buf, 4, pitch_obs);
    _mav_put_float(buf, 8, yaw_obs_mag);
    _mav_put_float(buf, 12, yaw_obs_rtk);
    _mav_put_float(buf, 16, roll_obs_sub_pred);
    _mav_put_float(buf, 20, pitch_obs_sub_pred);
    _mav_put_float(buf, 24, yaw_obs_sub_pred);
    _mav_put_float(buf, 28, f_ib_n_x);
    _mav_put_float(buf, 32, f_ib_n_y);
    _mav_put_float(buf, 36, f_ib_n_z);
    _mav_put_float(buf, 40, g0_x);
    _mav_put_float(buf, 44, g0_y);
    _mav_put_float(buf, 48, g0_z);
    _mav_put_float(buf, 52, declination);
    _mav_put_float(buf, 56, inclination);
    _mav_put_float(buf, 60, nm_earth_x);
    _mav_put_float(buf, 64, nm_earth_y);
    _mav_put_float(buf, 68, nm_earth_z);
    _mav_put_float(buf, 72, nm_x);
    _mav_put_float(buf, 76, nm_y);
    _mav_put_float(buf, 80, nm_z);
    _mav_put_float(buf, 84, RN);
    _mav_put_float(buf, 88, RE);
    _mav_put_float(buf, 92, v_eb_n_obs_x);
    _mav_put_float(buf, 96, v_eb_n_obs_y);
    _mav_put_float(buf, 100, v_eb_n_obs_z);
    _mav_put_float(buf, 104, p_eb_n_obs_x);
    _mav_put_float(buf, 108, p_eb_n_obs_y);
    _mav_put_float(buf, 112, p_eb_n_obs_z);
    _mav_put_float(buf, 116, w_ib_b_norm);
    _mav_put_float(buf, 120, f_ib_b_norm);
    _mav_put_float(buf, 124, bm_norm);
    _mav_put_uint32_t(buf, 128, time_used);
    _mav_put_uint32_t(buf, 132, dt);
    _mav_put_uint32_t(buf, 136, static_state);
    _mav_put_uint32_t(buf, 140, disturb_state);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG, buf, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
#else
    mavlink_att_body_debug_t packet;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.f_ib_n_x = f_ib_n_x;
    packet.f_ib_n_y = f_ib_n_y;
    packet.f_ib_n_z = f_ib_n_z;
    packet.g0_x = g0_x;
    packet.g0_y = g0_y;
    packet.g0_z = g0_z;
    packet.declination = declination;
    packet.inclination = inclination;
    packet.nm_earth_x = nm_earth_x;
    packet.nm_earth_y = nm_earth_y;
    packet.nm_earth_z = nm_earth_z;
    packet.nm_x = nm_x;
    packet.nm_y = nm_y;
    packet.nm_z = nm_z;
    packet.RN = RN;
    packet.RE = RE;
    packet.v_eb_n_obs_x = v_eb_n_obs_x;
    packet.v_eb_n_obs_y = v_eb_n_obs_y;
    packet.v_eb_n_obs_z = v_eb_n_obs_z;
    packet.p_eb_n_obs_x = p_eb_n_obs_x;
    packet.p_eb_n_obs_y = p_eb_n_obs_y;
    packet.p_eb_n_obs_z = p_eb_n_obs_z;
    packet.w_ib_b_norm = w_ib_b_norm;
    packet.f_ib_b_norm = f_ib_b_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.dt = dt;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
#endif
}

/**
 * @brief Send a att_body_debug message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_att_body_debug_send_struct(mavlink_channel_t chan, const mavlink_att_body_debug_t* att_body_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_att_body_debug_send(chan, att_body_debug->roll_obs, att_body_debug->pitch_obs, att_body_debug->yaw_obs_mag, att_body_debug->yaw_obs_rtk, att_body_debug->roll_obs_sub_pred, att_body_debug->pitch_obs_sub_pred, att_body_debug->yaw_obs_sub_pred, att_body_debug->f_ib_n_x, att_body_debug->f_ib_n_y, att_body_debug->f_ib_n_z, att_body_debug->g0_x, att_body_debug->g0_y, att_body_debug->g0_z, att_body_debug->declination, att_body_debug->inclination, att_body_debug->nm_earth_x, att_body_debug->nm_earth_y, att_body_debug->nm_earth_z, att_body_debug->nm_x, att_body_debug->nm_y, att_body_debug->nm_z, att_body_debug->RN, att_body_debug->RE, att_body_debug->v_eb_n_obs_x, att_body_debug->v_eb_n_obs_y, att_body_debug->v_eb_n_obs_z, att_body_debug->p_eb_n_obs_x, att_body_debug->p_eb_n_obs_y, att_body_debug->p_eb_n_obs_z, att_body_debug->w_ib_b_norm, att_body_debug->f_ib_b_norm, att_body_debug->bm_norm, att_body_debug->time_used, att_body_debug->dt, att_body_debug->static_state, att_body_debug->disturb_state);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG, (const char *)att_body_debug, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
#endif
}

#if MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_att_body_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float f_ib_n_x, float f_ib_n_y, float f_ib_n_z, float g0_x, float g0_y, float g0_z, float declination, float inclination, float nm_earth_x, float nm_earth_y, float nm_earth_z, float nm_x, float nm_y, float nm_z, float RN, float RE, float v_eb_n_obs_x, float v_eb_n_obs_y, float v_eb_n_obs_z, float p_eb_n_obs_x, float p_eb_n_obs_y, float p_eb_n_obs_z, float w_ib_b_norm, float f_ib_b_norm, float bm_norm, uint32_t time_used, uint32_t dt, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_float(buf, 0, roll_obs);
    _mav_put_float(buf, 4, pitch_obs);
    _mav_put_float(buf, 8, yaw_obs_mag);
    _mav_put_float(buf, 12, yaw_obs_rtk);
    _mav_put_float(buf, 16, roll_obs_sub_pred);
    _mav_put_float(buf, 20, pitch_obs_sub_pred);
    _mav_put_float(buf, 24, yaw_obs_sub_pred);
    _mav_put_float(buf, 28, f_ib_n_x);
    _mav_put_float(buf, 32, f_ib_n_y);
    _mav_put_float(buf, 36, f_ib_n_z);
    _mav_put_float(buf, 40, g0_x);
    _mav_put_float(buf, 44, g0_y);
    _mav_put_float(buf, 48, g0_z);
    _mav_put_float(buf, 52, declination);
    _mav_put_float(buf, 56, inclination);
    _mav_put_float(buf, 60, nm_earth_x);
    _mav_put_float(buf, 64, nm_earth_y);
    _mav_put_float(buf, 68, nm_earth_z);
    _mav_put_float(buf, 72, nm_x);
    _mav_put_float(buf, 76, nm_y);
    _mav_put_float(buf, 80, nm_z);
    _mav_put_float(buf, 84, RN);
    _mav_put_float(buf, 88, RE);
    _mav_put_float(buf, 92, v_eb_n_obs_x);
    _mav_put_float(buf, 96, v_eb_n_obs_y);
    _mav_put_float(buf, 100, v_eb_n_obs_z);
    _mav_put_float(buf, 104, p_eb_n_obs_x);
    _mav_put_float(buf, 108, p_eb_n_obs_y);
    _mav_put_float(buf, 112, p_eb_n_obs_z);
    _mav_put_float(buf, 116, w_ib_b_norm);
    _mav_put_float(buf, 120, f_ib_b_norm);
    _mav_put_float(buf, 124, bm_norm);
    _mav_put_uint32_t(buf, 128, time_used);
    _mav_put_uint32_t(buf, 132, dt);
    _mav_put_uint32_t(buf, 136, static_state);
    _mav_put_uint32_t(buf, 140, disturb_state);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG, buf, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
#else
    mavlink_att_body_debug_t *packet = (mavlink_att_body_debug_t *)msgbuf;
    packet->roll_obs = roll_obs;
    packet->pitch_obs = pitch_obs;
    packet->yaw_obs_mag = yaw_obs_mag;
    packet->yaw_obs_rtk = yaw_obs_rtk;
    packet->roll_obs_sub_pred = roll_obs_sub_pred;
    packet->pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet->yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet->f_ib_n_x = f_ib_n_x;
    packet->f_ib_n_y = f_ib_n_y;
    packet->f_ib_n_z = f_ib_n_z;
    packet->g0_x = g0_x;
    packet->g0_y = g0_y;
    packet->g0_z = g0_z;
    packet->declination = declination;
    packet->inclination = inclination;
    packet->nm_earth_x = nm_earth_x;
    packet->nm_earth_y = nm_earth_y;
    packet->nm_earth_z = nm_earth_z;
    packet->nm_x = nm_x;
    packet->nm_y = nm_y;
    packet->nm_z = nm_z;
    packet->RN = RN;
    packet->RE = RE;
    packet->v_eb_n_obs_x = v_eb_n_obs_x;
    packet->v_eb_n_obs_y = v_eb_n_obs_y;
    packet->v_eb_n_obs_z = v_eb_n_obs_z;
    packet->p_eb_n_obs_x = p_eb_n_obs_x;
    packet->p_eb_n_obs_y = p_eb_n_obs_y;
    packet->p_eb_n_obs_z = p_eb_n_obs_z;
    packet->w_ib_b_norm = w_ib_b_norm;
    packet->f_ib_b_norm = f_ib_b_norm;
    packet->bm_norm = bm_norm;
    packet->time_used = time_used;
    packet->dt = dt;
    packet->static_state = static_state;
    packet->disturb_state = disturb_state;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_BODY_DEBUG, (const char *)packet, MAVLINK_MSG_ID_ATT_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATT_BODY_DEBUG_CRC);
#endif
}
#endif

#endif

// MESSAGE ATT_BODY_DEBUG UNPACKING


/**
 * @brief Get field roll_obs from att_body_debug message
 *
 * @return  roll observe.
 */
static inline float mavlink_msg_att_body_debug_get_roll_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field pitch_obs from att_body_debug message
 *
 * @return  pitch observe.
 */
static inline float mavlink_msg_att_body_debug_get_pitch_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  4);
}

/**
 * @brief Get field yaw_obs_mag from att_body_debug message
 *
 * @return  yaw observe with magnet.
 */
static inline float mavlink_msg_att_body_debug_get_yaw_obs_mag(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field yaw_obs_rtk from att_body_debug message
 *
 * @return  yaw observe with rtk.
 */
static inline float mavlink_msg_att_body_debug_get_yaw_obs_rtk(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field roll_obs_sub_pred from att_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_att_body_debug_get_roll_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field pitch_obs_sub_pred from att_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_att_body_debug_get_pitch_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field yaw_obs_sub_pred from att_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_att_body_debug_get_yaw_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Get field f_ib_n_x from att_body_debug message
 *
 * @return  x force in B coordinate.
 */
static inline float mavlink_msg_att_body_debug_get_f_ib_n_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field f_ib_n_y from att_body_debug message
 *
 * @return  y force in B coordinate.
 */
static inline float mavlink_msg_att_body_debug_get_f_ib_n_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field f_ib_n_z from att_body_debug message
 *
 * @return  z force in B coordinate.
 */
static inline float mavlink_msg_att_body_debug_get_f_ib_n_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field g0_x from att_body_debug message
 *
 * @return  g0_x.
 */
static inline float mavlink_msg_att_body_debug_get_g0_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field g0_y from att_body_debug message
 *
 * @return  g0_y.
 */
static inline float mavlink_msg_att_body_debug_get_g0_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field g0_z from att_body_debug message
 *
 * @return  g0_z.
 */
static inline float mavlink_msg_att_body_debug_get_g0_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field declination from att_body_debug message
 *
 * @return  declination.
 */
static inline float mavlink_msg_att_body_debug_get_declination(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field inclination from att_body_debug message
 *
 * @return  inclination.
 */
static inline float mavlink_msg_att_body_debug_get_inclination(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field nm_earth_x from att_body_debug message
 *
 * @return  nm_earth_x.
 */
static inline float mavlink_msg_att_body_debug_get_nm_earth_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field nm_earth_y from att_body_debug message
 *
 * @return  nm_earth_y.
 */
static inline float mavlink_msg_att_body_debug_get_nm_earth_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field nm_earth_z from att_body_debug message
 *
 * @return  nm_earth_z.
 */
static inline float mavlink_msg_att_body_debug_get_nm_earth_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  68);
}

/**
 * @brief Get field nm_x from att_body_debug message
 *
 * @return  nm_x.
 */
static inline float mavlink_msg_att_body_debug_get_nm_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  72);
}

/**
 * @brief Get field nm_y from att_body_debug message
 *
 * @return  nm_y.
 */
static inline float mavlink_msg_att_body_debug_get_nm_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  76);
}

/**
 * @brief Get field nm_z from att_body_debug message
 *
 * @return  nm_z.
 */
static inline float mavlink_msg_att_body_debug_get_nm_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  80);
}

/**
 * @brief Get field RN from att_body_debug message
 *
 * @return  RN.
 */
static inline float mavlink_msg_att_body_debug_get_RN(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  84);
}

/**
 * @brief Get field RE from att_body_debug message
 *
 * @return  RE.
 */
static inline float mavlink_msg_att_body_debug_get_RE(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  88);
}

/**
 * @brief Get field v_eb_n_obs_x from att_body_debug message
 *
 * @return  v_eb_n_obs_x.
 */
static inline float mavlink_msg_att_body_debug_get_v_eb_n_obs_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  92);
}

/**
 * @brief Get field v_eb_n_obs_y from att_body_debug message
 *
 * @return  v_eb_n_obs_y.
 */
static inline float mavlink_msg_att_body_debug_get_v_eb_n_obs_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  96);
}

/**
 * @brief Get field v_eb_n_obs_z from att_body_debug message
 *
 * @return  v_eb_n_obs_z.
 */
static inline float mavlink_msg_att_body_debug_get_v_eb_n_obs_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  100);
}

/**
 * @brief Get field p_eb_n_obs_x from att_body_debug message
 *
 * @return  p_eb_n_obs_x.
 */
static inline float mavlink_msg_att_body_debug_get_p_eb_n_obs_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  104);
}

/**
 * @brief Get field p_eb_n_obs_y from att_body_debug message
 *
 * @return  p_eb_n_obs_y.
 */
static inline float mavlink_msg_att_body_debug_get_p_eb_n_obs_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  108);
}

/**
 * @brief Get field p_eb_n_obs_z from att_body_debug message
 *
 * @return  p_eb_n_obs_z.
 */
static inline float mavlink_msg_att_body_debug_get_p_eb_n_obs_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  112);
}

/**
 * @brief Get field w_ib_b_norm from att_body_debug message
 *
 * @return  w_ib_b_norm.
 */
static inline float mavlink_msg_att_body_debug_get_w_ib_b_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  116);
}

/**
 * @brief Get field f_ib_b_norm from att_body_debug message
 *
 * @return  f_ib_b_norm.
 */
static inline float mavlink_msg_att_body_debug_get_f_ib_b_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  120);
}

/**
 * @brief Get field bm_norm from att_body_debug message
 *
 * @return  bm_norm.
 */
static inline float mavlink_msg_att_body_debug_get_bm_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  124);
}

/**
 * @brief Get field time_used from att_body_debug message
 *
 * @return  used time.
 */
static inline uint32_t mavlink_msg_att_body_debug_get_time_used(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  128);
}

/**
 * @brief Get field dt from att_body_debug message
 *
 * @return  dt.
 */
static inline uint32_t mavlink_msg_att_body_debug_get_dt(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  132);
}

/**
 * @brief Get field static_state from att_body_debug message
 *
 * @return  static state.
 */
static inline uint32_t mavlink_msg_att_body_debug_get_static_state(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  136);
}

/**
 * @brief Get field disturb_state from att_body_debug message
 *
 * @return  disturb state.
 */
static inline uint32_t mavlink_msg_att_body_debug_get_disturb_state(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  140);
}

/**
 * @brief Decode a att_body_debug message into a struct
 *
 * @param msg The message to decode
 * @param att_body_debug C-struct to decode the message contents into
 */
static inline void mavlink_msg_att_body_debug_decode(const mavlink_message_t* msg, mavlink_att_body_debug_t* att_body_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    att_body_debug->roll_obs = mavlink_msg_att_body_debug_get_roll_obs(msg);
    att_body_debug->pitch_obs = mavlink_msg_att_body_debug_get_pitch_obs(msg);
    att_body_debug->yaw_obs_mag = mavlink_msg_att_body_debug_get_yaw_obs_mag(msg);
    att_body_debug->yaw_obs_rtk = mavlink_msg_att_body_debug_get_yaw_obs_rtk(msg);
    att_body_debug->roll_obs_sub_pred = mavlink_msg_att_body_debug_get_roll_obs_sub_pred(msg);
    att_body_debug->pitch_obs_sub_pred = mavlink_msg_att_body_debug_get_pitch_obs_sub_pred(msg);
    att_body_debug->yaw_obs_sub_pred = mavlink_msg_att_body_debug_get_yaw_obs_sub_pred(msg);
    att_body_debug->f_ib_n_x = mavlink_msg_att_body_debug_get_f_ib_n_x(msg);
    att_body_debug->f_ib_n_y = mavlink_msg_att_body_debug_get_f_ib_n_y(msg);
    att_body_debug->f_ib_n_z = mavlink_msg_att_body_debug_get_f_ib_n_z(msg);
    att_body_debug->g0_x = mavlink_msg_att_body_debug_get_g0_x(msg);
    att_body_debug->g0_y = mavlink_msg_att_body_debug_get_g0_y(msg);
    att_body_debug->g0_z = mavlink_msg_att_body_debug_get_g0_z(msg);
    att_body_debug->declination = mavlink_msg_att_body_debug_get_declination(msg);
    att_body_debug->inclination = mavlink_msg_att_body_debug_get_inclination(msg);
    att_body_debug->nm_earth_x = mavlink_msg_att_body_debug_get_nm_earth_x(msg);
    att_body_debug->nm_earth_y = mavlink_msg_att_body_debug_get_nm_earth_y(msg);
    att_body_debug->nm_earth_z = mavlink_msg_att_body_debug_get_nm_earth_z(msg);
    att_body_debug->nm_x = mavlink_msg_att_body_debug_get_nm_x(msg);
    att_body_debug->nm_y = mavlink_msg_att_body_debug_get_nm_y(msg);
    att_body_debug->nm_z = mavlink_msg_att_body_debug_get_nm_z(msg);
    att_body_debug->RN = mavlink_msg_att_body_debug_get_RN(msg);
    att_body_debug->RE = mavlink_msg_att_body_debug_get_RE(msg);
    att_body_debug->v_eb_n_obs_x = mavlink_msg_att_body_debug_get_v_eb_n_obs_x(msg);
    att_body_debug->v_eb_n_obs_y = mavlink_msg_att_body_debug_get_v_eb_n_obs_y(msg);
    att_body_debug->v_eb_n_obs_z = mavlink_msg_att_body_debug_get_v_eb_n_obs_z(msg);
    att_body_debug->p_eb_n_obs_x = mavlink_msg_att_body_debug_get_p_eb_n_obs_x(msg);
    att_body_debug->p_eb_n_obs_y = mavlink_msg_att_body_debug_get_p_eb_n_obs_y(msg);
    att_body_debug->p_eb_n_obs_z = mavlink_msg_att_body_debug_get_p_eb_n_obs_z(msg);
    att_body_debug->w_ib_b_norm = mavlink_msg_att_body_debug_get_w_ib_b_norm(msg);
    att_body_debug->f_ib_b_norm = mavlink_msg_att_body_debug_get_f_ib_b_norm(msg);
    att_body_debug->bm_norm = mavlink_msg_att_body_debug_get_bm_norm(msg);
    att_body_debug->time_used = mavlink_msg_att_body_debug_get_time_used(msg);
    att_body_debug->dt = mavlink_msg_att_body_debug_get_dt(msg);
    att_body_debug->static_state = mavlink_msg_att_body_debug_get_static_state(msg);
    att_body_debug->disturb_state = mavlink_msg_att_body_debug_get_disturb_state(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN;
        memset(att_body_debug, 0, MAVLINK_MSG_ID_ATT_BODY_DEBUG_LEN);
    memcpy(att_body_debug, _MAV_PAYLOAD(msg), len);
#endif
}
